using System.ComponentModel.DataAnnotations;
using System.Data.Entity.ModelConfiguration;
using SalesPages.DomainModel;

namespace SalesPages.EntityFrameworkRepository.Mapping
{
    public class ContactUsMap : EntityTypeConfiguration<ContactUs>
    {
        public ContactUsMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            this.Property(t => t.Type)
                .HasMaxLength(50);

            this.Property(t => t.FirstName)
                .HasMaxLength(50);

            this.Property(t => t.LastName)
                .HasMaxLength(50);

            this.Property(t => t.MobileTel)
                .HasMaxLength(50);

            this.Property(t => t.DayTel)
                .HasMaxLength(50);

            this.Property(t => t.NightTel)
                .HasMaxLength(50);

            this.Property(t => t.Email)
                .HasMaxLength(50);

            this.Property(t => t.Address1)
                .HasMaxLength(150);

            this.Property(t => t.Address2)
                .HasMaxLength(150);

            this.Property(t => t.City)
                .HasMaxLength(50);

            this.Property(t => t.PostalCode)
                .HasMaxLength(50);

            this.Property(t => t.Country)
                .HasMaxLength(2);

            this.Property(t => t.School)
                .HasMaxLength(50);

            this.Property(t => t.CourseLevel)
                .HasMaxLength(50);

            this.Property(t => t.LeadEtag)
                .HasMaxLength(100);

            this.Property(t => t.HearAbout)
                .HasMaxLength(50);

            this.Property(t => t.status)
                .HasMaxLength(2);

            this.Property(t => t.ip)
                .HasMaxLength(30);

            this.Property(t => t.Comments2)
                .HasMaxLength(4000);

            this.Property(t => t.FormType)
                .HasMaxLength(50);

            this.Property(t => t.Url)
                .HasMaxLength(150);

            this.Property(t => t.FirstLandingUrl)
                .HasMaxLength(150);

            this.Property(t => t.LastTouchEtag)
                .HasMaxLength(100);

            this.Property(t => t.CooperationComName)
                .HasMaxLength(50);

            this.Property(t => t.CooperationComDetail)
                .HasMaxLength(50);

            this.Property(t => t.FirstTouchEtag)
                .HasMaxLength(100);

            this.Property(t => t.PageName)
                .HasMaxLength(200);

            this.Property(t => t.GAID)
                .HasMaxLength(20);

            this.Property(t => t.CurLandingUrl)
                .HasMaxLength(150);

            this.Property(t => t.RAFVoucherCode)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("ContactUs");
            this.Property(t => t.Id).HasColumnName("ContactUsId");
            this.Property(t => t.Type).HasColumnName("Type");
            this.Property(t => t.FirstName).HasColumnName("FirstName");
            this.Property(t => t.LastName).HasColumnName("LastName");
            this.Property(t => t.MobileTel).HasColumnName("MobileTel");
            this.Property(t => t.DayTel).HasColumnName("DayTel");
            this.Property(t => t.NightTel).HasColumnName("NightTel");
            this.Property(t => t.Email).HasColumnName("Email");
            this.Property(t => t.Address1).HasColumnName("Address1");
            this.Property(t => t.Address2).HasColumnName("Address2");
            this.Property(t => t.City).HasColumnName("City");
            this.Property(t => t.PostalCode).HasColumnName("PostalCode");
            this.Property(t => t.Country).HasColumnName("Country");
            this.Property(t => t.Birthdate).HasColumnName("Birthdate");
            this.Property(t => t.School).HasColumnName("School");
            this.Property(t => t.CourseLevel).HasColumnName("CourseLevel");
            this.Property(t => t.Comments).HasColumnName("Comments");
            this.Property(t => t.MoreInfo).HasColumnName("MoreInfo");
            this.Property(t => t.DateSubmitted).HasColumnName("DateSubmitted");
            this.Property(t => t.LeadEtag).HasColumnName("LeadEtag");
            this.Property(t => t.HearAbout).HasColumnName("HearAbout");
            this.Property(t => t.consultant_id).HasColumnName("consultant_id");
            this.Property(t => t.apptime).HasColumnName("apptime");
            this.Property(t => t.status).HasColumnName("status");
            this.Property(t => t.valid).HasColumnName("valid");
            this.Property(t => t.lastupdate).HasColumnName("lastupdate");
            this.Property(t => t.server).HasColumnName("server");
            this.Property(t => t.ip).HasColumnName("ip");
            this.Property(t => t.priority).HasColumnName("priority");
            this.Property(t => t.Comments2).HasColumnName("Comments2");
            this.Property(t => t.FormType).HasColumnName("FormType");
            this.Property(t => t.Url).HasColumnName("Url");
            this.Property(t => t.FirstLandingUrl).HasColumnName("FirstLandingUrl");
            this.Property(t => t.LastTouchEtag).HasColumnName("LastTouchEtag");
            this.Property(t => t.CooperationComName).HasColumnName("CooperationComName");
            this.Property(t => t.CooperationComDetail).HasColumnName("CooperationComDetail");
            this.Property(t => t.FirstTouchEtag).HasColumnName("FirstTouchEtag");
            this.Property(t => t.PageName).HasColumnName("PageName");
            this.Property(t => t.HasLandedOnE1EC).HasColumnName("HasLandedOnE1EC");
            this.Property(t => t.GAID).HasColumnName("GAID");
            this.Property(t => t.CurLandingUrl).HasColumnName("CurLandingUrl");
            this.Property(t => t.RecommenderOdinID).HasColumnName("RecommenderOdinID");
            this.Property(t => t.CampaignId).HasColumnName("CampaignId");
            this.Property(t => t.RAFVoucherCode).HasColumnName("RAFVoucherCode");
            this.Property(t => t.MoreInfo2).HasColumnName("MoreInfo2");
        }
    }
}
